package com.everspring.mapstruct.use.mapping;

import com.everspring.mapstruct.use.model.OrderDetail;
import com.everspring.mapstruct.use.model.OrderDetailVo;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * Description： TODO
 * Date： 2020/9/15 17:20
 *
 * @author changchun.xue
 */
@Mapper
public interface OrderDetailMapping {
    OrderDetailMapping INSTANCE = Mappers.getMapper(OrderDetailMapping.class);

    @Mappings({
            @Mapping(source = "id",target = "orderDetailId")
    })
    OrderDetailVo toVo(OrderDetail detail);

    @InheritInverseConfiguration
    OrderDetail toEntity(OrderDetailVo detailVo);
}
